<?php
/**
 * Created by laoyu.
 * User: hilaoyu@qq.com
 * Date: 2018/5/8
 * Time: 16:32
 */

namespace App\Abstracts\Entities;

use Hilaoyu\Utils\UtilSupport;
use Hilaoyu\LaravelExtend\Entity;
use Illuminate\Support\Facades\Hash;

abstract class AbstractEntityUsers extends Entity
{


    protected function alterSaveBefore($model, &$data)
    {
        $model = parent::alterSaveBefore($model, $data);

        if (isset($data['password']) && !empty($data['password'])) {
            $model->password = Hash::make($data['password']);
        }

        return $model;
    }


}
